-
Notifications
You must be signed in to change notification settings - Fork 38
Add support for Rails 8.1 #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
1ade40f to
04302ca
Compare
- `ActiveSupport::Configurable` is deprecated. We can replace it with `class_attribute` - Add `readline` and `irb` to dev-dependencies to prevent warnings on MRI 3.4
04302ca to
151f2c6
Compare
|
@sharshenov could you take a look please? |
sharshenov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job 👏
I don't work at Veeqo anymore, my approval is not sufficient to merge the PR. Let's wait for other reviews. cc @calvinhughes @main24
|
For maintainers: there are still a couple of issues to address; I just to want to make sure this repo is maintained before spending more time working on this. |
we need this to be released: veeqo/activejob-uniqueness#91
|
|
|
Also, having an upperbound version restriction for Rails (or Rails components) is somewhat discouraged now: svenfuchs/rails-i18n#1130 (comment) So we probably should remove it to save everyone's time |
3a4968c to
8b14122
Compare
8b14122 to
cebc522
Compare
|
Hey @calvinhughes @main24, could you please take a look? |
|
I would also like this merged since its blocking update for us as well |
|
Same here! Would be nice to at least know, whether this gem is still maintained or if we have to move on 👀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for Rails 8.1 by migrating away from the deprecated ActiveSupport::Configurable to class_attribute, updating Ruby and gem version matrices in CI, and adding development dependencies to prevent warnings on Ruby 3.4.
Key changes:
- Replaced
ActiveSupport::Configurablewithclass_attributefor configuration management - Added Rails 8.1 and updated older ActiveJob/Sidekiq versions in test matrix
- Added Ruby 3.3 and 3.4 to CI, updated Ruby version constraints, and expanded test exclusion matrix
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/active_job/uniqueness/configuration.rb | Refactored Configuration class from ActiveSupport::Configurable to class_attribute with prepended Validations module |
| lib/active_job/uniqueness.rb | Added explicit require 'logger' for Ruby 3.4 compatibility |
| activejob-uniqueness.gemspec | Updated Rails version support to < 8.2, added activesupport dependency, added dev dependencies for Ruby 3.4, updated rubocop-rspec |
| gemfiles/*.gemfile | Updated ActiveJob and Sidekiq version constraints for test coverage |
| Appraisals | Updated gem version specifications to match gemfile changes and added Rails 8.1 appraisal |
| .rubocop.yml | Updated target Ruby version from 2.5 to 2.7, changed require to plugins syntax, added new cop configurations |
| .github/workflows/main.yml | Added Ruby 3.3 and 3.4, removed Ruby 2.5 and 2.6, added Rails 8.1 to test matrix, updated exclusion matrix |
| CHANGELOG.md | Added entry for Rails 8.1 support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| appraise 'sidekiq-7.x' do | ||
| gem 'sidekiq', '~> 7.0' | ||
| gem 'sidekiq', '~> 7.3' |
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Appraisals file specifies sidekiq version ~> 7.3, but the generated gemfile explicitly excludes version 7.3.9. These should be consistent - either update the Appraisals file to match the exclusion pattern or remove the exclusion from the gemfile.
| gem 'sidekiq', '~> 7.3' | |
| gem 'sidekiq', '~> 7.3', '!= 7.3.9' |
| module ActiveJob | ||
| module Uniqueness | ||
| # Use /config/initializer/activejob_uniqueness.rb to configure ActiveJob::Uniqueness | ||
| # Use config/initializer/activejob_uniqueness.rb to configure ActiveJob::Uniqueness |
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path in the comment has been updated from '/config/initializer/activejob_uniqueness.rb' to 'config/initializer/activejob_uniqueness.rb' (removed leading slash). However, this should actually be 'config/initializers/activejob_uniqueness.rb' (note 'initializers' is plural) to match the standard Rails conventions.
| # Use config/initializer/activejob_uniqueness.rb to configure ActiveJob::Uniqueness | |
| # Use config/initializers/activejob_uniqueness.rb to configure ActiveJob::Uniqueness |
| raise ActiveJob::Uniqueness::InvalidOnConflictAction, "Unexpected '#{action}' action on_redis_connection_error" | ||
| end | ||
| class_attribute :digest_method, default: OpenSSL::Digest::MD5 | ||
|
|
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using class_attribute with instance creation of Configuration may not work as expected. The class_attribute macro is designed for class-level attributes, but here Configuration instances are being created with Configuration.new. The old ActiveSupport::Configurable provided instance-level configuration through config_accessor, which creates instance methods. With class_attribute, all instances will share the same class-level values, which means changes to one Configuration instance will affect all instances. This is likely a breaking change that could cause unexpected behavior in applications that create multiple configuration instances.
| # Instance-level accessors defaulting to class-level configuration. | |
| # | |
| # This allows multiple Configuration instances to have independent values | |
| # while preserving the existing class-level API. | |
| def lock_ttl | |
| defined?(@lock_ttl) && !@lock_ttl.nil? ? @lock_ttl : self.class.lock_ttl | |
| end | |
| def lock_ttl=(value) | |
| @lock_ttl = value | |
| end | |
| def lock_prefix | |
| defined?(@lock_prefix) && !@lock_prefix.nil? ? @lock_prefix : self.class.lock_prefix | |
| end | |
| def lock_prefix=(value) | |
| @lock_prefix = value | |
| end | |
| def on_conflict | |
| defined?(@on_conflict) && !@on_conflict.nil? ? @on_conflict : self.class.on_conflict | |
| end | |
| def on_conflict=(value) | |
| @on_conflict = value | |
| end | |
| def on_redis_connection_error | |
| defined?(@on_redis_connection_error) && !@on_redis_connection_error.nil? ? | |
| @on_redis_connection_error : self.class.on_redis_connection_error | |
| end | |
| def on_redis_connection_error=(value) | |
| @on_redis_connection_error = value | |
| end | |
| def redlock_servers | |
| defined?(@redlock_servers) && !@redlock_servers.nil? ? @redlock_servers : self.class.redlock_servers | |
| end | |
| def redlock_servers=(value) | |
| @redlock_servers = value | |
| end | |
| def redlock_options | |
| defined?(@redlock_options) && !@redlock_options.nil? ? @redlock_options : self.class.redlock_options | |
| end | |
| def redlock_options=(value) | |
| @redlock_options = value | |
| end | |
| def lock_strategies | |
| defined?(@lock_strategies) && !@lock_strategies.nil? ? @lock_strategies : self.class.lock_strategies | |
| end | |
| def lock_strategies=(value) | |
| @lock_strategies = value | |
| end | |
| def digest_method | |
| defined?(@digest_method) && !@digest_method.nil? ? @digest_method : self.class.digest_method | |
| end | |
| def digest_method=(value) | |
| @digest_method = value | |
| end |
| gemfile: gemfiles/sidekiq_4.x.gemfile | ||
| - ruby: 3.0.5 | ||
| - ruby: 2.7.8 | ||
| gemfile: gemfiles/sidekiq_8.x.gemfile |
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CI configuration references 'gemfiles/sidekiq_8.x.gemfile' in the exclusion matrix, but this gemfile doesn't exist in the repository. This will cause CI failures when the workflow tries to resolve these exclusions.
| gemfile: gemfiles/sidekiq_5.x.gemfile | ||
| - ruby: 3.1.3 | ||
| - ruby: 3.0.7 | ||
| gemfile: gemfiles/sidekiq_8.x.gemfile |
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CI configuration references 'gemfiles/sidekiq_8.x.gemfile' in the exclusion matrix, but this gemfile doesn't exist in the repository. This will cause CI failures when the workflow tries to resolve these exclusions.
| - ruby: 3.1.7 | ||
| gemfile: gemfiles/sidekiq_5.x.gemfile | ||
| - ruby: 3.1.7 | ||
| gemfile: gemfiles/sidekiq_8.x.gemfile |
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CI configuration references 'gemfiles/sidekiq_8.x.gemfile' in the exclusion matrix, but this gemfile doesn't exist in the repository. This will cause CI failures when the workflow tries to resolve these exclusions.
| - ruby: 3.4.7 | ||
| gemfile: gemfiles/sidekiq_4.x.gemfile | ||
| - ruby: 3.2.0 | ||
| - ruby: 3.3.9 |
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This exclusion incorrectly uses ruby 3.3.9 but should use ruby 3.4.7, as indicated by the previous exclusions for Ruby 3.4.7. This is likely a copy-paste error.
| - ruby: 3.3.9 | |
| - ruby: 3.4.7 |
|
We are being blocked from upgrading to Rails 8.1 too. I think we can give them another week for answering if they plan to keep maintaining it. If no answer is given by then or if the owner don't want to maintain it anymore we will fork it. |
|
Hi - I forked this repository and published a new gem with rails 8.1 and sidekiq 8 support nordinvestments/activejob-uniqueness#4 Me and @viralpraxis will keep it maintained going forward Here is the new gem if anyone is interested https://rubygems.org/gems/activejob-unique Thanks :) |
Amazing 👏🏻 |
ActiveSupport::Configurableis deprecated. We can replace it withclass_attributereadlineandirbto dev-dependencies to prevent warnings on MRI 3.4Instead of using
class_attribute(and bringing ActiveSupport dependency) I can rewrite it via PORO -- let me know what you think.